/*
 * FileWritter.h
 *
 *  Created on: Jun 27, 2014
 *      Author: carlos
 */

#ifndef FILEWRITTER_H_
#define FILEWRITTER_H_

#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;
class FileWritter {
public:
	FileWritter(string path);
	virtual ~FileWritter();
	void write(unsigned int code,int tableSize);
	/**
	 * Cierra el archivo y vacia el buffer
	 */
	void close();

private:

	string path;
	fstream archivo;

	unsigned char mycharBuffer;
	int bitsContIntbuffer;

	bool isBuffring;

private:
	void writeByte2(unsigned char byte2);
};

#endif /* FILEWRITTER_H_ */
